package ai.minimax;

import ai.minimax.algorithm.Minimax;
import ai.minimax.entities.Action;
import ai.minimax.entities.Player;
import ai.minimax.entities.State;

public class Controller {
	Minimax minimax;
	
	public Controller(Minimax minimax){
		this.minimax = minimax;
	}
	
	public void doComputerTurn(){
		// Computer turn
		minimax.doAction(minimax.minimaxDecision());
	}

	public void doPlayerTurn(int row, int col) {
		// Player turn
		minimax.doAction(new Action(row, col, Player.MIN));
		doComputerTurn();
	}

	public void resetGame() {
		minimax.setCurrentGameState(new State());
	}
}
